﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="AnyOffice.general.system.chatroom.index" %>
<%@ Reference Page="~/general/index.aspx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title></title>
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		
		<script>
function delete_session(session_id)
{
 msg='确认要删除该聊天室么？';
 if(window.confirm(msg))
 {
  URL="delete.aspx?session_id=" + session_id;
  window.location=URL;
 }
}
</script>
	</HEAD>
	<body class="bodycolor" topmargin="5">
		<form id="Form1" method="post" runat="server">
			<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
				<tr>
					<td class="Big"><img src="/images/notify_new.gif" align="absMiddle"><span class="big3"> 
							创建新的聊天室</span><br>
					</td>
				</tr>
			</table>
			<div align="center">
				<input type="button" value="新建聊天室" class="BigButton" onClick="location='new.aspx';">
			</div>
			<br>
			<table width="95%" border="0" cellspacing="0" cellpadding="0" height="3">
				<tr>
					<td background="/images/dian1.gif" width="100%"></td>
				</tr>
			</table>
			<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small" align="center">
				<tr>
					<td class="Big"><img src="/images/notify_open.gif" align="absMiddle"><span class="big3">
							管理已创建的聊天室</span><br>
					</td>
				</tr>
			</table>
			<br>
			<asp:Repeater id="rptChatSessions" runat="server">
				<HeaderTemplate>
					<table border="0" cellspacing="1" width="450" class="small" bgcolor="#000000" cellpadding="3"
						align="center">
						<tr class="TableHeader">
							<td nowrap align="center">聊天室名称</td>
							<td nowrap align="center">当前状态</td>
							<td nowrap align="center">操作</td>
						</tr>
				</HeaderTemplate>
				<ItemTemplate>
					<tr class="TableLine1">
						<td align="center"><%#Eval("SessionName")%></td>
						<td nowrap align="center"><%#Convert.ToBoolean(Eval("State")) == true ? "<font color='#00aa00'><b>开放</SPAN></b></font>" : "<font color='#ff0000'><b>关闭</SPAN></b></font>"%></td>
						<td nowrap align="center">
							<a href="switch.aspx?session_id=<%#Eval("SessionId")%>"><%#Convert.ToBoolean(Eval("State")) == true ? "关闭" : "开放"%></a>&nbsp;&nbsp;
						<a href="javascript:delete_session('<%#Eval("SessionId")%>');">删除</a>
						</td>
					</tr>
				</ItemTemplate>
				<AlternatingItemTemplate>
				<tr class="TableLine2">
						<td align="center"><%#Eval("SessionName")%></td>
						<td nowrap align="center"><%#Convert.ToBoolean(Eval("State")) == true ? "<font color='#00aa00'><b>开放</SPAN></b></font>" : "<font color='#ff0000'><b>关闭</SPAN></b></font>"%></td>
						<td nowrap align="center">
							<a href="switch.aspx?session_id=<%#Eval("SessionId")%>"><%#Convert.ToBoolean(Eval("State")) == true ? "关闭" : "开放"%></a>&nbsp;&nbsp;
						<a href="javascript:delete_session('<%#Eval("SessionId")%>');">删除</a>
						</td>
					</tr>
				</AlternatingItemTemplate>				
				<FooterTemplate>
					</table>
				</FooterTemplate>
			</asp:Repeater>
			<asp:Literal id="litMessage" runat="server"></asp:Literal>
		</form>
	</body>
</HTML>
